package cn.kgc.springcloud.config;

import com.netflix.loadbalancer.IRule;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author: mosin
 * @version: v1.0  2023/1/4
 */
@Configuration
public class BeanConfig {

    @Bean
    @LoadBalanced   //  标识restTemplate实例具有解析服务名称的能力 负载均衡的能力
    public RestTemplate restTemplate(){
        return  new RestTemplate();
    }
}
